/**
 * Created by 17311 on 2021/11/5.
 */
import request from '@/utils/request'

const api_name = 'village'

export default {
  search(searchMap) {
    return request({
      url: `/${api_name}/list`,
      method: 'post',
      data: searchMap
    })
  },
  update(id, pojo) {
    if (id === null || id === '') {
      // ����
      return this.save(pojo)
    }
    return request({
      url: `${api_name}/update`,
      method: 'post',
      data: pojo
    })
  },
  save(pojo) {
    return request({
      url: `${api_name}/add`,
      method: 'post',
      data: pojo
    })
  },
  findById(id) {
    return request({
      url: `${api_name}/find/` + id,
      method: 'get'
    })
  },
  deleteById(id) {
    return request({
      url: `${api_name}/deleteById/` + id,
      method: 'get'
    })
  }
}
